package com.huawei.appmarket.service.appdetail.view.adapter;

import android.app.Activity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.ImageView;
import android.widget.TextView;
import com.huawei.appmarket.service.appdetail.bean.report.GeneralResponse$ComplaIntegerData;
import com.huawei.appmarket.service.appdetail.view.widget.DetailReportCheckBox;
import java.util.List;
import o.azb;
import o.ewm.h;
import o.ewm.j;

public class DetailReportAdapter extends BaseAdapter {
    private List<GeneralResponse$ComplaIntegerData> data;
    private OnCheckedChangeListener listener;
    private LayoutInflater mInflater;

    static class d {
        private ImageView ˎ;
        private DetailReportCheckBox ˏ;
        private TextView ॱ;

        private d() {
        }
    }

    public DetailReportAdapter(Activity activity, List<GeneralResponse$ComplaIntegerData> list, OnCheckedChangeListener onCheckedChangeListener) {
        this.data = list;
        this.listener = onCheckedChangeListener;
        this.mInflater = LayoutInflater.from(activity);
    }

    public int getCount() {
        return this.data.size();
    }

    public Object getItem(int i) {
        return this.data.get(i);
    }

    public long getItemId(int i) {
        return (long) i;
    }

    public View getView(int i, View view, ViewGroup viewGroup) {
        d dVar;
        if (view == null) {
            dVar = new d();
            view = this.mInflater.inflate(h.ˮ, null);
            azb.ˏ(view);
            dVar.ˏ = (DetailReportCheckBox) view.findViewById(j.ˋˑ);
            dVar.ॱ = (TextView) view.findViewById(j.ﹶᐝ);
            dVar.ˎ = (ImageView) view.findViewById(j.ᐧᐝ);
            view.setTag(dVar);
        } else {
            dVar = (d) view.getTag();
        }
        dVar.ˎ.setVisibility(0);
        dVar.ˏ.ˋ = (GeneralResponse$ComplaIntegerData) this.data.get(i);
        dVar.ˏ.setOnCheckedChangeListener(this.listener);
        dVar.ॱ.setText(((GeneralResponse$ComplaIntegerData) this.data.get(i)).ˊ());
        dVar.ˏ.setChecked(((GeneralResponse$ComplaIntegerData) this.data.get(i)).ॱ());
        if (i == this.data.size() - 1) {
            dVar.ˎ.setVisibility(8);
        }
        return view;
    }

    public void clear() {
        for (GeneralResponse$ComplaIntegerData ˎ : this.data) {
            ˎ.ˎ(false);
        }
    }
}
